package com.yide.myworld.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageParam implements Serializable {
    private int pageNum = 1;
    private int pageSize = 20;

    public int getOffsetStart() {
        int start = (this.pageNum - 1) * this.pageSize;
        return Math.max(start, 0);
    }
}
